//
//  HomeEntity.m
//  SXH
//
//  Created by 房 国生 on 15/7/16.
//  Copyright (c) 2015年 lyss. All rights reserved.
//

#import "HomeEntity.h"
#import "ParkEntity.h"

@implementation HomeEntity
@synthesize mutableArrayFind, mutableArrayLP, mutableArrayPark;
@synthesize mutableArrayRoute;

- (instancetype)initWithAttributes:(NSDictionary *)attributes
{
    self = [super init];
    if (!self) {
        return nil;
    }
    
    mutableArrayPark = [[NSMutableArray alloc] init];
    mutableArrayFind = [[NSMutableArray alloc] init];
    mutableArrayLP = [[NSMutableArray alloc] init];
    mutableArrayRoute = [[NSMutableArray alloc] init];
    
    NSArray *array = [attributes objectForKey:@"parkRows"];
    for (NSDictionary* attr in array) {
        ParkEntity *parkEntity = [[ParkEntity alloc] init];
        parkEntity = [parkEntity initWithAttributes:attr];
        [mutableArrayPark addObject:parkEntity];
    }

    array = [attributes objectForKey:@"travelLine"];
    for (NSDictionary* attr in array) {
        ParkEntity *parkEntity = [[ParkEntity alloc] init];
        parkEntity = [parkEntity initWithAttributes:attr];
        [mutableArrayRoute addObject:parkEntity];
    }
    
    array = [attributes objectForKey:@"travelRows"];
    for (NSDictionary* attr in array) {
        ParkEntity *parkEntity = [[ParkEntity alloc] init];
        parkEntity = [parkEntity initWithAttributes:attr];
        [mutableArrayFind addObject:parkEntity];
    }
    
    array = [attributes objectForKey:@"specialtyRows"];
    for (NSDictionary* attr in array) {
        ParkEntity *parkEntity = [[ParkEntity alloc] init];
        parkEntity = [parkEntity initWithAttributes:attr];
        [mutableArrayLP addObject:parkEntity];
    }
    
    return self;
}


@end
